package comment

import (
	"common/mildware"
	"common/router"
	"github.com/gin-gonic/gin"
	"video/pkg/dao/mysql"
	"video/pkg/dao/redis"
)

type CRouter struct {
}

type CHandler struct {
	M mysql.Mysql
	R redis.Redis
}

func NewCHandler() CHandler {
	return CHandler{
		M: mysql.NewMysql(),
		R: redis.NewRedis(),
	}
}
func init() {
	router.AddRouter(new(CRouter))
}
func (CRouter) Router(e *gin.Engine) {
	handler := NewCHandler()
	comment := e.Group("/v1/comment")
	comment.POST("video/one/all", handler.GetVideAllComment)
	comment.POST("video/more/info", handler.GetMoreComment)
	comment.Use(mildware.JWTAuthMiddleware())
	comment.POST("video/add", handler.AddVideoToComment)
	comment.POST("del", handler.DeleteComment)
}
